<!DOCTYPE html>
<html>
  <head>
    <script src="../dist/jspsych.js"></script>
    <script src="../dist/plugin-call-function.js"></script>
    <link rel="stylesheet" href="../dist/jspsych.css">
  </head>
  <body></body>
  <script>

  var jsPsych = initJsPsych({
    default_iti: 1000, 
    on_finish: function() {
      jsPsych.data.displayData();
    }
  });

  var trial = {
    type: jsPsychCallFunction,
    post_trial_gap: 0,
    func: function(){ 
      var timestamp = Date.now();
      console.log('trial 1: ', timestamp);
      return timestamp;
    }
  };

  // This is to check if the plugin-specific default for post_trial_gap works.
  // If it does, then the return values for the two trials should be nearly identical.
  var next_trial = {
    type: jsPsychCallFunction,
    func: function(){ 
      var timestamp = Date.now();
      console.log('trial 2: ', timestamp);
      return timestamp;
    }
  };

  jsPsych.run([trial, next_trial]);

  </script>
</html>
